Imports System.Text
Public Class frmARcustomerEdit
    Inherits System.Windows.Forms.Form
    Dim arp As frmARcustomer

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents dgShowroom As System.Windows.Forms.DataGrid
    Friend WithEvents cmbGroup1 As System.Windows.Forms.ComboBox
    Friend WithEvents tbName As System.Windows.Forms.TextBox
    Friend WithEvents tbAdr1 As System.Windows.Forms.TextBox
    Friend WithEvents tbAdr2 As System.Windows.Forms.TextBox
    Friend WithEvents tbEmail As System.Windows.Forms.TextBox
    Friend WithEvents tbWebsite As System.Windows.Forms.TextBox
    Friend WithEvents tbPhone As System.Windows.Forms.TextBox
    Friend WithEvents tbFax As System.Windows.Forms.TextBox
    Friend WithEvents tbContact As System.Windows.Forms.TextBox
    Friend WithEvents tbDadr2 As System.Windows.Forms.TextBox
    Friend WithEvents tbDadr1 As System.Windows.Forms.TextBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents tbCusCode As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents cmbSalesman As System.Windows.Forms.ComboBox
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents dtpActStart As System.Windows.Forms.DateTimePicker
    Friend WithEvents dtpStart As System.Windows.Forms.DateTimePicker
    Friend WithEvents dtpEnd As System.Windows.Forms.DateTimePicker
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents cmbContractType As System.Windows.Forms.ComboBox
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents txtContractAmt As System.Windows.Forms.TextBox
    Friend WithEvents txtInfo As System.Windows.Forms.TextBox
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents GroupPanel1 As DevComponents.DotNetBar.Controls.GroupPanel
    Friend WithEvents cmdSave As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdExit As DevComponents.DotNetBar.ButtonX
    Friend WithEvents chBlocked As System.Windows.Forms.CheckBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.tbName = New System.Windows.Forms.TextBox()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label13 = New System.Windows.Forms.Label()
        Me.tbAdr1 = New System.Windows.Forms.TextBox()
        Me.tbAdr2 = New System.Windows.Forms.TextBox()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.tbEmail = New System.Windows.Forms.TextBox()
        Me.tbWebsite = New System.Windows.Forms.TextBox()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.tbPhone = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.tbFax = New System.Windows.Forms.TextBox()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.tbContact = New System.Windows.Forms.TextBox()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.dgShowroom = New System.Windows.Forms.DataGrid()
        Me.cmbGroup1 = New System.Windows.Forms.ComboBox()
        Me.tbDadr2 = New System.Windows.Forms.TextBox()
        Me.tbDadr1 = New System.Windows.Forms.TextBox()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.tbCusCode = New System.Windows.Forms.TextBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.cmbSalesman = New System.Windows.Forms.ComboBox()
        Me.chBlocked = New System.Windows.Forms.CheckBox()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.dtpActStart = New System.Windows.Forms.DateTimePicker()
        Me.dtpStart = New System.Windows.Forms.DateTimePicker()
        Me.dtpEnd = New System.Windows.Forms.DateTimePicker()
        Me.Label16 = New System.Windows.Forms.Label()
        Me.cmbContractType = New System.Windows.Forms.ComboBox()
        Me.Label12 = New System.Windows.Forms.Label()
        Me.Label15 = New System.Windows.Forms.Label()
        Me.Label14 = New System.Windows.Forms.Label()
        Me.txtContractAmt = New System.Windows.Forms.TextBox()
        Me.txtInfo = New System.Windows.Forms.TextBox()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.Label17 = New System.Windows.Forms.Label()
        Me.GroupPanel1 = New DevComponents.DotNetBar.Controls.GroupPanel()
        Me.cmdSave = New DevComponents.DotNetBar.ButtonX()
        Me.cmdExit = New DevComponents.DotNetBar.ButtonX()
        CType(Me.dgShowroom, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupPanel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'tbName
        '
        Me.tbName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbName.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbName.Location = New System.Drawing.Point(12, 74)
        Me.tbName.Name = "tbName"
        Me.tbName.Size = New System.Drawing.Size(365, 26)
        Me.tbName.TabIndex = 22
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.Color.Transparent
        Me.Label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label2.Location = New System.Drawing.Point(10, 29)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(108, 18)
        Me.Label2.TabIndex = 24
        Me.Label2.Text = "Customer Name"
        '
        'Label13
        '
        Me.Label13.AutoSize = True
        Me.Label13.BackColor = System.Drawing.Color.Transparent
        Me.Label13.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label13.Location = New System.Drawing.Point(380, 85)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(141, 18)
        Me.Label13.TabIndex = 94
        Me.Label13.Text = "Office/Postal Address"
        '
        'tbAdr1
        '
        Me.tbAdr1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAdr1.Location = New System.Drawing.Point(383, 129)
        Me.tbAdr1.Name = "tbAdr1"
        Me.tbAdr1.Size = New System.Drawing.Size(251, 26)
        Me.tbAdr1.TabIndex = 24
        '
        'tbAdr2
        '
        Me.tbAdr2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAdr2.Location = New System.Drawing.Point(383, 156)
        Me.tbAdr2.Name = "tbAdr2"
        Me.tbAdr2.Size = New System.Drawing.Size(251, 26)
        Me.tbAdr2.TabIndex = 25
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.BackColor = System.Drawing.Color.Transparent
        Me.Label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label3.Location = New System.Drawing.Point(10, 144)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(42, 18)
        Me.Label3.TabIndex = 99
        Me.Label3.Text = "Email"
        '
        'tbEmail
        '
        Me.tbEmail.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbEmail.Location = New System.Drawing.Point(77, 166)
        Me.tbEmail.Name = "tbEmail"
        Me.tbEmail.Size = New System.Drawing.Size(300, 26)
        Me.tbEmail.TabIndex = 27
        '
        'tbWebsite
        '
        Me.tbWebsite.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbWebsite.Location = New System.Drawing.Point(77, 192)
        Me.tbWebsite.Name = "tbWebsite"
        Me.tbWebsite.Size = New System.Drawing.Size(300, 26)
        Me.tbWebsite.TabIndex = 28
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.BackColor = System.Drawing.Color.Transparent
        Me.Label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label4.Location = New System.Drawing.Point(10, 170)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(59, 18)
        Me.Label4.TabIndex = 101
        Me.Label4.Text = "Website"
        '
        'tbPhone
        '
        Me.tbPhone.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbPhone.Location = New System.Drawing.Point(77, 220)
        Me.tbPhone.Name = "tbPhone"
        Me.tbPhone.Size = New System.Drawing.Size(300, 26)
        Me.tbPhone.TabIndex = 29
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.BackColor = System.Drawing.Color.Transparent
        Me.Label5.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label5.Location = New System.Drawing.Point(10, 198)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(48, 18)
        Me.Label5.TabIndex = 103
        Me.Label5.Text = "Phone"
        '
        'tbFax
        '
        Me.tbFax.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbFax.Location = New System.Drawing.Point(77, 247)
        Me.tbFax.Name = "tbFax"
        Me.tbFax.Size = New System.Drawing.Size(300, 26)
        Me.tbFax.TabIndex = 30
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.BackColor = System.Drawing.Color.Transparent
        Me.Label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label6.Location = New System.Drawing.Point(10, 225)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(29, 18)
        Me.Label6.TabIndex = 105
        Me.Label6.Text = "Fax"
        '
        'tbContact
        '
        Me.tbContact.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbContact.Location = New System.Drawing.Point(77, 274)
        Me.tbContact.Name = "tbContact"
        Me.tbContact.Size = New System.Drawing.Size(300, 26)
        Me.tbContact.TabIndex = 31
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.BackColor = System.Drawing.Color.Transparent
        Me.Label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label7.Location = New System.Drawing.Point(10, 252)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(55, 18)
        Me.Label7.TabIndex = 107
        Me.Label7.Text = "Contact"
        '
        'dgShowroom
        '
        Me.dgShowroom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgShowroom.CaptionVisible = False
        Me.dgShowroom.DataMember = ""
        Me.dgShowroom.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgShowroom.Location = New System.Drawing.Point(12, 375)
        Me.dgShowroom.Name = "dgShowroom"
        Me.dgShowroom.RowHeadersVisible = False
        Me.dgShowroom.Size = New System.Drawing.Size(777, 187)
        Me.dgShowroom.TabIndex = 32
        '
        'cmbGroup1
        '
        Me.cmbGroup1.BackColor = System.Drawing.Color.AliceBlue
        Me.cmbGroup1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbGroup1.Location = New System.Drawing.Point(459, 74)
        Me.cmbGroup1.Name = "cmbGroup1"
        Me.cmbGroup1.Size = New System.Drawing.Size(175, 26)
        Me.cmbGroup1.TabIndex = 23
        '
        'tbDadr2
        '
        Me.tbDadr2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbDadr2.Location = New System.Drawing.Point(383, 237)
        Me.tbDadr2.Name = "tbDadr2"
        Me.tbDadr2.Size = New System.Drawing.Size(251, 26)
        Me.tbDadr2.TabIndex = 112
        '
        'tbDadr1
        '
        Me.tbDadr1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbDadr1.Location = New System.Drawing.Point(383, 210)
        Me.tbDadr1.Name = "tbDadr1"
        Me.tbDadr1.Size = New System.Drawing.Size(251, 26)
        Me.tbDadr1.TabIndex = 111
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.BackColor = System.Drawing.Color.Transparent
        Me.Label8.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label8.Location = New System.Drawing.Point(380, 166)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(113, 18)
        Me.Label8.TabIndex = 113
        Me.Label8.Text = "Delivery Address"
        '
        'tbCusCode
        '
        Me.tbCusCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbCusCode.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbCusCode.Location = New System.Drawing.Point(383, 74)
        Me.tbCusCode.MaxLength = 6
        Me.tbCusCode.Name = "tbCusCode"
        Me.tbCusCode.Size = New System.Drawing.Size(69, 26)
        Me.tbCusCode.TabIndex = 114
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label1.Location = New System.Drawing.Point(10, 84)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(67, 18)
        Me.Label1.TabIndex = 129
        Me.Label1.Text = "Salesman"
        '
        'cmbSalesman
        '
        Me.cmbSalesman.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbSalesman.Location = New System.Drawing.Point(12, 128)
        Me.cmbSalesman.Name = "cmbSalesman"
        Me.cmbSalesman.Size = New System.Drawing.Size(365, 26)
        Me.cmbSalesman.TabIndex = 128
        '
        'chBlocked
        '
        Me.chBlocked.AutoSize = True
        Me.chBlocked.BackColor = System.Drawing.Color.Transparent
        Me.chBlocked.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.chBlocked.Location = New System.Drawing.Point(380, 310)
        Me.chBlocked.Name = "chBlocked"
        Me.chBlocked.Size = New System.Drawing.Size(123, 22)
        Me.chBlocked.TabIndex = 130
        Me.chBlocked.Text = "Block Customer"
        Me.chBlocked.UseVisualStyleBackColor = False
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.BackColor = System.Drawing.Color.Transparent
        Me.Label9.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label9.Location = New System.Drawing.Point(453, 29)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(75, 18)
        Me.Label9.TabIndex = 24
        Me.Label9.Text = "Cus. Group"
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.BackColor = System.Drawing.Color.Transparent
        Me.Label10.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label10.Location = New System.Drawing.Point(377, 29)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(69, 18)
        Me.Label10.TabIndex = 24
        Me.Label10.Text = "Cus. Code"
        '
        'dtpActStart
        '
        Me.dtpActStart.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpActStart.Location = New System.Drawing.Point(648, 183)
        Me.dtpActStart.Name = "dtpActStart"
        Me.dtpActStart.Size = New System.Drawing.Size(127, 26)
        Me.dtpActStart.TabIndex = 140
        '
        'dtpStart
        '
        Me.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpStart.Location = New System.Drawing.Point(648, 72)
        Me.dtpStart.Name = "dtpStart"
        Me.dtpStart.Size = New System.Drawing.Size(128, 26)
        Me.dtpStart.TabIndex = 138
        '
        'dtpEnd
        '
        Me.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpEnd.Location = New System.Drawing.Point(648, 127)
        Me.dtpEnd.Name = "dtpEnd"
        Me.dtpEnd.Size = New System.Drawing.Size(128, 26)
        Me.dtpEnd.TabIndex = 139
        '
        'Label16
        '
        Me.Label16.AutoSize = True
        Me.Label16.BackColor = System.Drawing.Color.Transparent
        Me.Label16.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label16.Location = New System.Drawing.Point(644, 138)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(111, 18)
        Me.Label16.TabIndex = 141
        Me.Label16.Text = "Actual Start Date"
        '
        'cmbContractType
        '
        Me.cmbContractType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbContractType.FormattingEnabled = True
        Me.cmbContractType.Location = New System.Drawing.Point(645, 240)
        Me.cmbContractType.Name = "cmbContractType"
        Me.cmbContractType.Size = New System.Drawing.Size(144, 26)
        Me.cmbContractType.TabIndex = 137
        '
        'Label12
        '
        Me.Label12.AutoSize = True
        Me.Label12.BackColor = System.Drawing.Color.Transparent
        Me.Label12.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label12.Location = New System.Drawing.Point(642, 197)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(92, 18)
        Me.Label12.TabIndex = 136
        Me.Label12.Text = "Contract Type"
        '
        'Label15
        '
        Me.Label15.AutoSize = True
        Me.Label15.BackColor = System.Drawing.Color.Transparent
        Me.Label15.ForeColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer))
        Me.Label15.Location = New System.Drawing.Point(643, 84)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(63, 18)
        Me.Label15.TabIndex = 134
        Me.Label15.Text = "End Date"
        '
        'Label14
        '
        Me.Label14.AutoSize = True
        Me.Label14.BackColor = System.Drawing.Color.Transparent
        Me.Label14.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label14.Location = New System.Drawing.Point(643, 29)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(69, 18)
        Me.Label14.TabIndex = 135
        Me.Label14.Text = "Start Date"
        '
        'txtContractAmt
        '
        Me.txtContractAmt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtContractAmt.Location = New System.Drawing.Point(383, 292)
        Me.txtContractAmt.Name = "txtContractAmt"
        Me.txtContractAmt.Size = New System.Drawing.Size(106, 26)
        Me.txtContractAmt.TabIndex = 142
        Me.txtContractAmt.Text = "0"
        Me.txtContractAmt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'txtInfo
        '
        Me.txtInfo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtInfo.Location = New System.Drawing.Point(513, 292)
        Me.txtInfo.Multiline = True
        Me.txtInfo.Name = "txtInfo"
        Me.txtInfo.Size = New System.Drawing.Size(276, 67)
        Me.txtInfo.TabIndex = 143
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.BackColor = System.Drawing.Color.Transparent
        Me.Label11.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label11.Location = New System.Drawing.Point(380, 249)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(89, 18)
        Me.Label11.TabIndex = 145
        Me.Label11.Text = "Contract Amt"
        '
        'Label17
        '
        Me.Label17.AutoSize = True
        Me.Label17.BackColor = System.Drawing.Color.Transparent
        Me.Label17.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label17.Location = New System.Drawing.Point(501, 247)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(88, 18)
        Me.Label17.TabIndex = 144
        Me.Label17.Text = "Contract Info"
        '
        'GroupPanel1
        '
        Me.GroupPanel1.CanvasColor = System.Drawing.SystemColors.Control
        Me.GroupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007
        Me.GroupPanel1.Controls.Add(Me.cmdSave)
        Me.GroupPanel1.Controls.Add(Me.cmdExit)
        Me.GroupPanel1.Controls.Add(Me.Label9)
        Me.GroupPanel1.Controls.Add(Me.Label2)
        Me.GroupPanel1.Controls.Add(Me.Label11)
        Me.GroupPanel1.Controls.Add(Me.Label10)
        Me.GroupPanel1.Controls.Add(Me.Label17)
        Me.GroupPanel1.Controls.Add(Me.Label13)
        Me.GroupPanel1.Controls.Add(Me.Label3)
        Me.GroupPanel1.Controls.Add(Me.Label4)
        Me.GroupPanel1.Controls.Add(Me.Label5)
        Me.GroupPanel1.Controls.Add(Me.Label16)
        Me.GroupPanel1.Controls.Add(Me.Label6)
        Me.GroupPanel1.Controls.Add(Me.Label7)
        Me.GroupPanel1.Controls.Add(Me.Label12)
        Me.GroupPanel1.Controls.Add(Me.Label8)
        Me.GroupPanel1.Controls.Add(Me.Label15)
        Me.GroupPanel1.Controls.Add(Me.Label1)
        Me.GroupPanel1.Controls.Add(Me.Label14)
        Me.GroupPanel1.Controls.Add(Me.chBlocked)
        Me.GroupPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.GroupPanel1.Location = New System.Drawing.Point(0, 0)
        Me.GroupPanel1.Name = "GroupPanel1"
        Me.GroupPanel1.Size = New System.Drawing.Size(807, 619)
        '
        '
        '
        Me.GroupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2
        Me.GroupPanel1.Style.BackColorGradientAngle = 90
        Me.GroupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground
        Me.GroupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderBottomWidth = 1
        Me.GroupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder
        Me.GroupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderLeftWidth = 1
        Me.GroupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderRightWidth = 1
        Me.GroupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderTopWidth = 1
        Me.GroupPanel1.Style.CornerDiameter = 4
        Me.GroupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded
        Me.GroupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center
        Me.GroupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText
        Me.GroupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near
        Me.GroupPanel1.TabIndex = 146
        Me.GroupPanel1.Text = "AR Customer - Edit"
        '
        'cmdSave
        '
        Me.cmdSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdSave.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdSave.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdSave.Location = New System.Drawing.Point(614, 556)
        Me.cmdSave.Name = "cmdSave"
        Me.cmdSave.Size = New System.Drawing.Size(82, 27)
        Me.cmdSave.TabIndex = 254
        Me.cmdSave.Text = "Save"
        '
        'cmdExit
        '
        Me.cmdExit.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdExit.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdExit.Location = New System.Drawing.Point(704, 556)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(82, 27)
        Me.cmdExit.TabIndex = 253
        Me.cmdExit.Text = "Exit"
        '
        'ARcustomerEdit
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.SystemColors.ActiveCaption
        Me.ClientSize = New System.Drawing.Size(807, 619)
        Me.ControlBox = False
        Me.Controls.Add(Me.txtContractAmt)
        Me.Controls.Add(Me.txtInfo)
        Me.Controls.Add(Me.dtpActStart)
        Me.Controls.Add(Me.dtpStart)
        Me.Controls.Add(Me.dtpEnd)
        Me.Controls.Add(Me.cmbContractType)
        Me.Controls.Add(Me.cmbSalesman)
        Me.Controls.Add(Me.tbCusCode)
        Me.Controls.Add(Me.cmbGroup1)
        Me.Controls.Add(Me.tbName)
        Me.Controls.Add(Me.tbDadr2)
        Me.Controls.Add(Me.tbDadr1)
        Me.Controls.Add(Me.dgShowroom)
        Me.Controls.Add(Me.tbContact)
        Me.Controls.Add(Me.tbFax)
        Me.Controls.Add(Me.tbPhone)
        Me.Controls.Add(Me.tbWebsite)
        Me.Controls.Add(Me.tbEmail)
        Me.Controls.Add(Me.tbAdr2)
        Me.Controls.Add(Me.tbAdr1)
        Me.Controls.Add(Me.GroupPanel1)
        Me.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.SystemColors.ControlLightLight
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
        Me.Location = New System.Drawing.Point(100, 120)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "ARcustomerEdit"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        CType(Me.dgShowroom, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupPanel1.ResumeLayout(False)
        Me.GroupPanel1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub ARcustomerAdd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ICdata As New ICdataLogic
        Dim ds2 As DataSet
        ds2 = ICdata.GetCompanySalesmen(CompanyID, DepartmentID, 0)
        cmbSalesman.DataSource = ds2.Tables(0)
        cmbSalesman.ValueMember = "SalesmanID"
        cmbSalesman.DisplayMember = "Salesman"
        ICdata = Nothing

        LoadShowrooms(EditCusID)
        LoadGroupCombos(CompanyID)
        PopulateCustomerData(EditCusID)
        Call ToLoadContractType()
    End Sub
    Sub ToLoadContractType()
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet
        ds = ICdata.GetContractType()
        cmbContractType.DataSource = ds.Tables(0)
        cmbContractType.ValueMember = "ContractType"
        cmbContractType.DisplayMember = "ContractCode"

    End Sub
    Private Sub PopulateCustomerData(ByVal EditCusID As Integer)
        Dim ARdata As New ARdataLogic
        Dim ds As DataSet
        ds = ARdata.GetCustomerDetails(EditCusID)
        tbName.Text = ds.Tables(0).Rows(0).Item("CusName").ToString()
        tbCusCode.Text = ds.Tables(0).Rows(0).Item("CusCode").ToString()
        tbAdr1.Text = ds.Tables(0).Rows(0).Item("CusAdr1").ToString()
        tbAdr2.Text = ds.Tables(0).Rows(0).Item("CusAdr2").ToString()
        tbDadr1.Text = ds.Tables(0).Rows(0).Item("CusdAdr1").ToString()
        tbDadr2.Text = ds.Tables(0).Rows(0).Item("CusdAdr2").ToString()
        tbEmail.Text = ds.Tables(0).Rows(0).Item("CusEmail").ToString()
        tbWebsite.Text = ds.Tables(0).Rows(0).Item("CusWebUrl").ToString()
        tbPhone.Text = ds.Tables(0).Rows(0).Item("CusTelephone").ToString()
        tbFax.Text = ds.Tables(0).Rows(0).Item("CusFax").ToString()
        tbContact.Text = ds.Tables(0).Rows(0).Item("CusContact").ToString()
        cmbSalesman.SelectedValue = ds.Tables(0).Rows(0).Item("SalesmanID")
        dtpStart.Value = ds.Tables(0).Rows(0).Item("StartDate")
        dtpEnd.Value = ds.Tables(0).Rows(0).Item("EndDate")
        dtpActStart.Value = ds.Tables(0).Rows(0).Item("ActStartDate")
        txtInfo.Text = ds.Tables(0).Rows(0).Item("ContractInfo")
        cmbContractType.SelectedValue = ds.Tables(0).Rows(0).Item("ContractType")
        txtContractAmt.Text = ds.Tables(0).Rows(0).Item("ContractAmt")

        If IsNumeric(ds.Tables(0).Rows(0).Item("CusGroupID").ToString()) Then
            cmbGroup1.SelectedValue = Integer.Parse(ds.Tables(0).Rows(0).Item("CusGroupID").ToString())
        End If
        ARdata = Nothing
    End Sub
    Private Sub LoadGroupCombos(ByVal CompanyCode As Integer)
        Dim ARdata As New ARdataLogic
        Dim ds As DataSet
        ds = ARdata.GetCustomerGroups()
        cmbGroup1.DataSource = ds.Tables(0)
        cmbGroup1.ValueMember = "GroupID"
        cmbGroup1.DisplayMember = "GroupName"
        cmbGroup1.SelectedValue = 0
        ARdata = Nothing
    End Sub
    Private Sub LoadShowrooms(ByVal CusID As Integer)
        Dim ICdata As New ICdataLogic
        Dim ds As DataSet
        ds = ICdata.GetCompanyUpdatedCrLimitPrompt(CusID)
        dgShowroom.DataSource = ds.Tables(0)
        ICdata = Nothing
        With dgShowroom
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With

        Dim cm As CurrencyManager = BindingContext(dgShowroom.DataSource, dgShowroom.DataMember)
        Dim dv As DataView = cm.List
        dv.AllowNew = False
        dgformat(ds.Tables(0).Rows.Count)
    End Sub
    Private Sub dgformat(ByVal RowCount As Integer)
        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Calibri", 9.0!, FontStyle.Bold)
            .MappingName = "COMPANY"
            .PreferredColumnWidth = 140
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With
        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 0
        cs1.MappingName = "COMPANYID"
        cs1.HeaderText = "ID"
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        Dim cs2 As DataGridBoolColumn
        cs2 = New DataGridBoolColumn
        cs2.Width = 30
        cs2.MappingName = "VALIDCOMPANY"
        cs2.ReadOnly = False
        cs2.FalseValue = 0
        cs2.TrueValue = 1
        cs2.AllowNull = False
        grdTableStyle.GridColumnStyles.Add(cs2)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.MappingName = "COMPANYNAME"
        cs1.HeaderText = "COMPANY"
        cs1.Width = 250
        cs1.NullText = ""
        cs1.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs1)
        '
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 115
        cs1.MappingName = "CREDITLIMIT"
        cs1.HeaderText = "CR.LIMIT "
        cs1.NullText = ""
        cs1.ReadOnly = False
        cs1.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs1)
        '

        cs1 = New DataGridTextBoxColumn
        cs1.Width = 115
        cs1.MappingName = "CRPERIOD"
        cs1.HeaderText = "CR.PERIOD(M) "
        cs1.NullText = ""
        cs1.ReadOnly = False
        cs1.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs1)


        dgShowroom.TableStyles.Add(grdTableStyle)
    End Sub

    Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        Me.Close()
    End Sub
    Private Sub dgShowroom_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dgShowroom.MouseUp
        Dim pt As New Point(e.X, e.Y)
        Dim hti As DataGrid.HitTestInfo = dgShowroom.HitTest(pt)
        If hti.Type = DataGrid.HitTestType.Cell Then
            dgShowroom.CurrentCell = New DataGridCell(hti.Row, hti.Column)
            'dgShowroom.Select(hti.Row)
            Dim CurrentRow As Integer = dgShowroom.CurrentCell.RowNumber
            If dgShowroom.Item(CurrentRow, 1) = True Then
                dgShowroom.Item(CurrentRow, 1) = False
            Else
                dgShowroom.Item(CurrentRow, 1) = True
            End If
        End If
    End Sub

    Private Sub tbCode_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbName_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbName.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbAdr1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbAdr1.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbAdr2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbAdr2.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbAdr3_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbEmail_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbEmail.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbFax_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbFax.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbPhone_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbPhone.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub tbWebsite_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbWebsite.KeyUp
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub

    Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        If cmbGroup1.SelectedValue = 0 Then
            MsgBox("Select Customer Group", MsgBoxStyle.Critical, "Inventory Manager")
            Exit Sub
        End If
        Dim mrow, drow As Integer
        Dim cm As CurrencyManager = BindingContext(dgShowroom.DataSource, dgShowroom.DataMember)
        Dim dv As DataView = cm.List
        mrow = dv.Count

        Dim sb As StringBuilder = New StringBuilder("")
        Dim InvXml As String
        sb.Append("<InvoiceDetails>")
        sb.Append("<InvoiceData>")
        Dim n As Integer
        Dim ValidCompanies As Integer = 0
        For n = 0 To mrow - 1
            sb.Append("<InvLine>")
            sb.Append("<CompanyID>" + CStr(dgShowroom.Item(n, 0)) + "</CompanyID>")
            sb.Append("<IncludeCustomer>" + CStr(dgShowroom.Item(n, 1)) + "</IncludeCustomer>")
            sb.Append("<CreditLimit>" + CStr(dgShowroom.Item(n, 3)) + "</CreditLimit>")
            sb.Append("<CreditPeriod>" + CStr(dgShowroom.Item(n, 4)) + "</CreditPeriod>")
            sb.Append("</InvLine>")
            If CStr(dgShowroom.Item(n, 1)).ToUpper = "TRUE" Then
                ValidCompanies = ValidCompanies + 1
            End If
        Next
        If ValidCompanies = 0 Then
            MsgBox("Atleast one company to be selected", MsgBoxStyle.Critical, "Inventory Manager")
            Exit Sub
        End If
        Dim Blocked As Integer
        If chBlocked.Checked = True Then
            Blocked = 1
        Else
            Blocked = 0
        End If

        sb.Append("</InvoiceData>")
        sb.Append("</InvoiceDetails>")
        InvXml = sb.ToString()

        Dim ARdata As New ARdataLogic
        Try
            ARdata.UpdateCustomerDetails(EditCusID, tbCusCode.Text, cmbGroup1.SelectedValue, tbName.Text, tbAdr1.Text, tbAdr2.Text, tbDadr1.Text, tbDadr2.Text, tbEmail.Text, tbWebsite.Text, tbPhone.Text, tbFax.Text, tbContact.Text, cmbSalesman.SelectedValue, Blocked, InvXml, cmbContractType.SelectedValue, txtContractAmt.Text.Trim, dtpStart.Value.ToShortDateString, dtpEnd.Value.ToShortDateString, dtpActStart.Value.ToShortDateString, txtInfo.Text.Trim)
            MsgBox("Customer:" & tbName.Text & " updated.", MsgBoxStyle.Information, "Inventory Manager")
            tbName.Text = ""
            tbCusCode.Clear()
        Catch Ex As Exception
            MsgBox("Unable to satisfy your request." & vbLf & "Try again later.", MsgBoxStyle.Critical, "Inventory Manager")
        Finally
            ARdata = Nothing
        End Try
    End Sub
End Class
